package com.abner.design.patterns.command;

/**
 * 将一个接受者对象与一个命令绑定，调用接受者相应的操作，实现 execute
 * @author abner
 */
public class LightOnCommand implements Command {

	LightReceiver light;
	
	public LightOnCommand(LightReceiver light) {
		super();
		this.light = light;
	}
	
	@Override
	public void execute() {
		light.on();
	}

	@Override
	public void undo() {
		light.off();
	}

}
